/*
 * @Author: xushuhao
 * @Email: xshmouse@163.com
 * @Date: 2020-04-30 15:16:01
 * @Last Modified by: xushuhao
 * @Last Modified time: 2020-07-28 08:39:34
 * @Description: 播放器DEMO 默认大屏
 */

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_code_framework/widgets/x_video_player.dart';
import 'package:auto_orientation/auto_orientation.dart';

class DemoPlayer extends StatefulWidget {
  String sourceType;
  List<PlayerInputInstance> path;

  DemoPlayer({
    Key key,
    this.sourceType,
    this.path = null,
  }) : super(key: key);
  @override
  DemoPlayerState createState() {
    return DemoPlayerState();
  }
}

class DemoPlayerState extends State<DemoPlayer> {
  @override
  Widget build(BuildContext context) {
    //全屏 强制横屏
    AutoOrientation.landscapeRightMode();
    //启动横屏陀螺仪
    AutoOrientation.landscapeAutoMode();
    return XVideoPlayer(
      isPlay: false,
      path: widget.path,
      sourceType: widget.sourceType,
    );
  }
}
